

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>${fieldValue(bean:courseInstance, field:'activityId')} - ${fieldValue(bean:courseInstance, field:'name')}</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="list" action="list">Course List</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">New Course</g:link></span>
        </div>
        <div class="body">
            <h1><b>${fieldValue(bean:courseInstance, field:'activityId')}</b> - ${fieldValue(bean:courseInstance, field:'name')}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog" style="float:left;">
                <h2>Details</h2>
                <table>
                    <tbody>
                         <!--<tr class="prop">
                            <td valign="top" class="name">Course code :</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'activityId')}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Name:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'name')}</td>
                            
                        </tr>
                        -->
                        <tr class="prop">
                            <td valign="top" class="name">Description:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'description')}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Level:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'level')}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Area:</td>
                            
                            <td valign="top" class="value"><g:link controller="area" action="show" id="${courseInstance?.area?.id}">${courseInstance?.area?.encodeAsHTML()}</g:link></td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Date:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'date')}</td>
                            
                        </tr>
                        <tr class="prop">
                            <td valign="top" class="name">Start Hour:</td>

                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'startHour')}</td>

                        </tr>
                        <tr class="prop">
                            <td valign="top" class="name">End Hour:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'endHour')}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Seats:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:courseInstance, field:'seats')}</td>
                            
                        </tr>
                    
                    </tbody>
                </table>
            </div>
            <div class="dialog" style="float:left; margin-left:20px">
              <h2>Members</h2>
              <div class="membersView">                  
                  <table>
                    <tbody>
                      <tr>
                          <th>Name</th>
                      </tr>
                      <g:each var="m" in="${courseInstance.amountOfHour}">
                      <tr>
                          <td><g:link action="show" controller="employee" id="${m?.member?.id}">${m?.member?.firstName} ${m?.member?.lastName}</g:link></td>
                      </tr>
                      </g:each>
                    </tbody>
                  </table>
                  <div class="buttons">
                  <g:form>
                      <input type="hidden" name="id" value="${courseInstance?.id}" />
                      <span class="button"><g:actionSubmit action ="add_employee" class="add_employee"  value="Add Employee" /></span>
                      <g:if test="${numberOfEmployees > 0}">
                        <span class="button"><g:actionSubmit action ="delete_employee" class="delete_employee"  value="Remove Employee" /></span>
                      </g:if>
                   </g:form>
                </div>
              </div>
            </div>

             <div class="buttons" style="clear:left; float:left;">
                <g:form>
                    <input type="hidden" name="id" value="${courseInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </g:form>
            </div>
            
                
        </div>
    </body>
</html>
